package com.hzdesk.media.koreabatchmatvector.factory;

import android.support.v4.app.Fragment;

import com.hzdesk.media.koreabatchmatvector.fragment.fragment_view.AboutFragment;
import com.hzdesk.media.koreabatchmatvector.fragment.fragment_view.BoundCloudServiceFragment;
import com.hzdesk.media.koreabatchmatvector.fragment.fragment_view.CloudListFragment;
import com.hzdesk.media.koreabatchmatvector.fragment.fragment_view.FileSelectFragment;
import com.hzdesk.media.koreabatchmatvector.fragment.fragment_view.MouseSetFragment;
import com.hzdesk.media.koreabatchmatvector.fragment.fragment_view.SetFragment;
import com.hzdesk.media.koreabatchmatvector.fragment.fragment_view.VideoListFragment;

import java.util.HashMap;

/**
 * Created by Administrator on 2018/6/22.
 * 杭州席媒科技有限公司  Developers  刘传华  15
 * 佛祖镇楼 bug辟易
 */

public class FragmentFactory {
    private static final int MY_SETTING = 0;            //系统设置页面
    private static final int MY_MOUSSE_LIST = 1;        //批注功能
    private static final int MY_VIDEO_LIST = 2;         // 本地视频  关于视频相关的操作在适配器里面
    private static final int MY_FILE_SELECT= 3;         // 选择文件
    private static final int MY_MOUSESET = 4;           //鼠标设置
    private static final int MY_boun_XLOUS_SERVICE= 5;  //绑定云服务
    private static final int MY_ABOUT = 6;              //关于可立批
    private static final int MY_CLOUD_LIST = 7;         //云端管理

    private static final HashMap<Integer,Fragment> map = new HashMap<>();

    public static Fragment createFragment(int position) {
        Fragment myFragment =  map.get(position);
        if(myFragment == null){
            switch (position){
                case MY_SETTING:
                    myFragment = new SetFragment();
                    break;
                case MY_MOUSSE_LIST:
                    //myFragment = new MouseListFragment();
                    break;
                case MY_VIDEO_LIST:
                    myFragment = new VideoListFragment();
                    break;
                case MY_FILE_SELECT:
                    myFragment = new FileSelectFragment();
                    break;
                case MY_MOUSESET:
                    myFragment = new MouseSetFragment();
                    break;
                case MY_boun_XLOUS_SERVICE:
                    myFragment = new BoundCloudServiceFragment();
                    break;
                case MY_ABOUT:
                    myFragment = new AboutFragment();
                    break;
                case MY_CLOUD_LIST:
                    myFragment = new CloudListFragment();
                    break;
            }
            map.put(position,myFragment);
        }
        return myFragment;
    }

}
